<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>京东(JD.COM)-正品低价、品质保障、配送及时、轻松购物！</title>
    <!-- 底部样式 -->
    <link rel="stylesheet" type="text/css" href="../css/normalize.css" />
    <!-- 头部和底部 结构基本相同 基本的公共样式 -->
    <link rel="stylesheet" type="text/css" href="../css/base.css" />
    <!--  -->
    <link rel="stylesheet" href="../css/reset.css">

    <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/5.15.2/css/all.css" rel="stylesheet"> <!-- layui 文件链接 -->
    <link rel="stylesheet" href="../../layui-v2.5.7/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../css/lunbotuzuoce.css"><!-- 左侧导航栏  -->
    <script src="https://cdn.staticfile.org/jquery/2.0.0/jquery.min.js"></script> <!-- JQquery 封装链接 -->
    <link rel="stylesheet" href="../../bootstrap-3.3.7-dist/css/bootstrap.css"><!-- bootstrap3链接 -->
    <script src="../../bootstrap-3.3.7-dist/js/bootstrap.min.js"></script><!-- bootstrap3链接 -->
    <script src="../js/axios.min.js"></script> <!-- ajax  封装包-->
    <script src="../../layui-v2.5.7/layui/layui.js"></script> <!-- layui 文件链接 -->
    <link rel="stylesheet" href="../css/index.css">
    <link rel="stylesheet" href="../js/API.js">

</head>
<script>
    function Ajax(listName, categoryCode) {
        let goods = document.querySelectorAll(listName)
        let res;
        //发起请求
        $.ajax({
            type: "get",
            url: "https://rods.suning.com/rods-web/route.jsonp?",
            async: false,
            data: {
                sceneCode: "C2076",
                apiCode: "J0281",
                channelCode: 1,
                c: 161166336354529658,
                cityId: 371,
                districtCode: 3710199,
                categoryCode: categoryCode
            },
            success: function (response) {
                res = response;
                return res
            }
        })
        console.log(112221)
        let obj = JSON.parse(res);
        let arr = obj.skus
        console.log(arr);
        for (let i = 0; i < 10; i++) {
            //拼字符串
            goods[i].innerHTML = `
       <img id="pic" src="https://${arr[i].pictureUrl}" alt="">
       <p id="title">${arr[i].gdsName}</p>
       <div id="price">${arr[i].price}</div>
     `
        }

    }

</script>

<body>
    <!-- 头部导航栏 -->
    <div class="top">
        <p><span class="glyphicon glyphicon-globe" aria-hidden="true"></span>河南</p>
        <ul>
            <li>你好,&nbsp;请登录&nbsp; <b style="color:red;">免费注册</b></li>
            <li>我的订单</li>
            <li>我的京东</li>
            <li style="color:red;">企业采购</li>
            <li>客户服务</li>
            <li>网站导航</li>
            <li>手机京东</li>
        </ul>
    </div>
    <!-- 搜索框 -->
    <div class="search">
        <div class="logoimg ">
            <img src="../img/JDlogo.gif" alt="">
        </div>
        <div class="searchbox">
            <!-- 搜索框字部分 -->
            <div class="input">
                <input type="text" placeholder="卷纸">
                <span class="glyphicon glyphicon-camera" aria-hidden="true"></span>
                <div class="inputbox">
                    <span class="glyphicon glyphicon-search" aria-hidden="true"></span>
                </div>
            </div>
            <!--搜索框小字部分 -->
            <p style="margin-left: 80px;margin-top: 5px;">
                <span>母婴好物抢</span>
                <span>荣耀</span>
                <span>二手手机</span>
                <span>家装建材</span>
                <span>宠物生活</span>
                <span>服饰年货</span>
                <span>健康年货</span>
                <span>车主福利</span>
                <span>居家年货</span>
            </p>
            <!--搜索框下部展示部分 -->
            <p class="trap" style="margin-left: 80px;margin-top: 20px;">
                <span>秒杀</span>
                <span>优惠券</span>
                <span>PLUS会员</span>
                <span>品牌闪购</span>
                <span>拍卖</span>
                <span>京东家电</span>
                <span>京东超市</span>
                <span>京东生鲜</span>
                <span>京东国际</span>
                <span>京东金融</span>
            </p>
            <!-- 搜索框-购物车部分 -->
            <a>
                <div class="cw-icon"><span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span> 我的购物车
                </div>
            </a>
            <!-- 搜索框-二维码部分 -->
            <div class="mobile_static_qrcode">
                <img src="../img/下载.png" alt="">
            </div>
        </div>

    </div>
    <!--轮播图部分 -->
    <div class="grid_c1 fs_inner">

        <!-- 左侧导航栏 -->

        <ul class="topmenu">
            <div class="toptitle">
                全部商品分类
            </div>
            <li><a href="#">图书、音像、数字产品</a><span></span>
                <!--仿苏宁悬浮文字 -->
                <b>
                    <a href="#">文学</a>
                    <a href="#">经管</a>
                    <a href="#">畅读VIP</a>
                </b>
                <div class="submenu">
                    <div class="leftdiv">
                        <dl>
                            <dt><a href="#">电子书</a> </dt>
                            <dd>
                                <a href="#">免费</a><a href="#">小说</a><a href="#">励志</a>
                                <a href="#">文学</a><a href="#">经管</a><a href="#">畅读</a>
                                <a href="#">免费</a><a href="#">小说</a><a href="#">励志</a>
                                <a href="#">文学</a><a href="#">经管</a><a href="#">畅读</a>
                            </dd>
                        </dl>
                        <dl>
                            <dt><a href="#">电子书</a> </dt>
                            <dd>
                                <a href="#">免费</a><a href="#">小说</a><a href="#">励志</a>
                                <a href="#">文学</a><a href="#">经管</a><a href="#">畅读</a>
                                <a href="#">免费</a><a href="#">小说</a><a href="#">励志</a>
                                <a href="#">文学</a><a href="#">经管</a><a href="#">畅读</a>
                            </dd>
                        </dl>
                        <dl>
                            <dt><a href="#">电子书</a> </dt>
                            <dd>
                                <a href="#">免费</a><a href="#">小说</a><a href="#">励志</a>
                                <a href="#">文学</a><a href="#">经管</a><a href="#">畅读</a>
                                <a href="#">免费</a><a href="#">小说</a><a href="#">励志</a>
                                <a href="#">文学</a><a href="#">经管</a><a href="#">畅读</a>
                            </dd>
                        </dl>
                    </div>
                    <div class="rightdiv">
                        <dl>
                            <dd>
                                <a href="#">
                                    <img src="images/1.jpg" width="194" height="70">
                                </a>
                            </dd>
                            <dd>
                                <a href="#">
                                    <img src="images/2.png" width="194" height="70">
                                </a>
                            </dd>
                        </dl>
                        <dl>
                            <dt>推荐品牌</dt>
                            <dd>
                                <a href="#">美的官方···</a>
                            </dd>
                            <dd>
                                <a href="#">美的官方···</a>
                            </dd>
                            <dd>
                                <a href="#">美的官方···</a>
                            </dd>
                            <dd>
                                <a href="#">美的官方···</a>
                            </dd>
                        </dl>
                        <!--悬浮图片 -->
                        <img class="rightPic" src="images/4.png">
                    </div>
                </div>
            </li>
            <li><a href="#">家用电器</a><span></span>
                <div class="submenu">
                    <div class="leftdiv">
                        <dl>
                            <dt><a href="#">111</a> </dt>
                            <dd>
                                <a href="#">免费</a><a href="#">小说</a><a href="#">励志</a>
                                <a href="#">文学</a><a href="#">经管</a><a href="#">畅读</a>
                                <a href="#">免费</a><a href="#">小说</a><a href="#">励志</a>
                                <a href="#">文学</a><a href="#">经管</a><a href="#">畅读</a>
                            </dd>
                        </dl>
                        <dl>
                            <dt><a href="#">222</a> </dt>
                            <dd>
                                <a href="#">免费</a><a href="#">小说</a><a href="#">励志</a>
                                <a href="#">文学</a><a href="#">经管</a><a href="#">畅读</a>
                                <a href="#">免费</a><a href="#">小说</a><a href="#">励志</a>
                                <a href="#">文学</a><a href="#">经管</a><a href="#">畅读</a>
                            </dd>
                        </dl>
                        <dl>
                            <dt><a href="#">333</a> </dt>
                            <dd>
                                <a href="#">免费</a><a href="#">小说</a><a href="#">励志</a>
                                <a href="#">文学</a><a href="#">经管</a><a href="#">畅读</a>
                                <a href="#">免费</a><a href="#">小说</a><a href="#">励志</a>
                                <a href="#">文学</a><a href="#">经管</a><a href="#">畅读</a>
                            </dd>
                        </dl>
                    </div>
            <li><a href="#">手机、数码</a></li>
            <li><a href="#">电脑、办公</a></li>
            <li><a href="#">家居、家具、家装、厨具</a></li>
            <li><a href="#">服饰内衣、珠宝首饰</a></li>
            <li><a href="#">个护化妆</a></li>
            <li><a href="#">鞋靴、箱包、钟表、奢侈品</a></li>
            <li><a href="#">运动户外</a></li>

            <li><a href="#">汽车用品</a><span></span>
                <div class="submenu">
                    <div class="leftdiv">
                        <dl>
                            <dt><a href="#">444</a> </dt>
                            <dd>
                                <a href="#">免费</a><a href="#">小说</a><a href="#">励志</a>
                                <a href="#">文学</a><a href="#">经管</a><a href="#">畅读</a>
                                <a href="#">免费</a><a href="#">小说</a><a href="#">励志</a>
                                <a href="#">文学</a><a href="#">经管</a><a href="#">畅读</a>
                            </dd>
                        </dl>
                        <dl>
                            <dt><a href="#">555</a> </dt>
                            <dd>
                                <a href="#">免费</a><a href="#">小说</a><a href="#">励志</a>
                                <a href="#">文学</a><a href="#">经管</a><a href="#">畅读</a>
                                <a href="#">免费</a><a href="#">小说</a><a href="#">励志</a>
                                <a href="#">文学</a><a href="#">经管</a><a href="#">畅读</a>
                            </dd>
                        </dl>
                        <dl>
                            <dt><a href="#">666</a> </dt>
                            <dd>
                                <a href="#">免费</a><a href="#">小说</a><a href="#">励志</a>
                                <a href="#">文学</a><a href="#">经管</a><a href="#">畅读</a>
                                <a href="#">免费</a><a href="#">小说</a><a href="#">励志</a>
                                <a href="#">文学</a><a href="#">经管</a><a href="#">畅读</a>
                            </dd>
                        </dl>
                    </div>
            <li><a href="#">母婴、玩具乐器</a></li>
            <li><a href="#">食品饮料、酒类、生鲜</a></li>
            <li><a href="#">营养保健</a></li>
        </ul>
        <!-- 导航栏轮播图片1  -->
        <div class="layui-carousel" id="test1">
            <div carousel-item>
                <div><img src="../img/2a0536b9d3e33a9b.jpg.webp" alt=""></div>
                <div><img src="../img/361ba1aa29cc9953.jpg.webp" alt=""></div>
                <div><img src="../img/3e25659f3474c19e.png.webp" alt=""></div>
                <div><img src="../img/a0a79c93999167bc.jpg.webp" alt=""></div>
                <div><img src="../img/ba435b3a5681fadf.jpg.webp" alt=""></div>

            </div>
        </div>
        <!--  导航栏轮播图片2 -->
        <div class="layui-carousel" id="test2">
            <div carousel-item>
                <div>
                    <img src="../img/1.jpg.webp" alt="">
                    <img src="../img/1-1.jpg.webp" alt="">
                    <img src="../img/1-2.png.webp" alt="">
                </div>
                <div>
                    <img src="../img/1.jpg.webp" alt="">
                    <img src="../img/1-3.jpg.webp" alt="">
                    <img src="../img/1-5.jpg.webp" alt="">
                </div>
                <div>
                    <img src="../img/1.jpg.webp" alt="">
                    <img src="../img/1-3.jpg.webp" alt="">
                    <img src="../img/1-4.jpg.webp" alt="">
                </div>
                <div>
                    <img src="../img/1-5.jpg.webp" alt="">
                    <img src="../img/1-3.jpg.webp" alt="">
                    <img src="../img/1-4.jpg.webp" alt="">
                </div>
                <div>条目5</div>
            </div>
        </div>
        <!--  右侧注册部分  -->
        <div class="fs_right">
            <!-- JD狗图标 -->
            <div class="fs_right-top">
                <div class="fs_right-top-img">
                    <img src="../img/下载JD狗 (1).png" alt="">
                </div>
                <p>Hi~欢迎逛京东!<br>
                    登录 | 注册</p>
                <div class="fs_right-topbox1">新人福利</div>
                <div class="fs_right-topbox2">PLUS会员</div>

            </div>
            <hr style=" width: 140px; margin: 10px auto;">
            <p>京东快报 <span style="float: right;">更多 ></span></p>
            <div class="fs_right-dibu">
                <p> <span>推荐</span> 2019年度真无线耳...</p>
                <p> <span>热评</span> 360°无死角吸尘，...</p>
                <p> <span>HOT</span> 四款主流脚垫横评！...</p>
                <p> <span>热门</span> 污渍难洗？久洗不新...</p>
            </div>
            <!-- 下部图标 -->
            <div class="fs_right-foot">
                <div><i class="layui-icon layui-icon-chart"></i> </div>
                <div><i class="layui-icon layui-icon-chart"></i> </div>
                <div><i class="layui-icon layui-icon-chart"></i> </div>
                <div><i class="layui-icon layui-icon-chart"></i> </div>
                <div><i class="layui-icon layui-icon-chart"></i> </div>
                <div><i class="layui-icon layui-icon-chart"></i> </div>
                <div><i class="glyphicon glyphicon-globe"></i></div>
                <div><i class="glyphicon glyphicon-globe"></i></div>
                <div><i class="glyphicon glyphicon-globe"></i></div>
                <div><i class="glyphicon glyphicon-globe"></i></div>
                <div><i class="glyphicon glyphicon-globe"></i></div>
                <div><i class="layui-icon layui-icon-chart"></i> </div>
            </div>
        </div>
    </div>
    <!-- 京东秒杀 -->
    <div class="miaosha">
        <!-- 倒计时 -->
        <div id="djs">
            <h2>倒计时</h2>
            <p>COUNT DOWN</p>
            <p>距离2月11日结束还剩</p>
            <ul class="time">
                <li class="hour"></li>
                <li class="min"></li>
                <li class="sec"></li>
            </ul>
        </div>
        <!-- 京东秒杀轮播图中间  -->
        <div class="layui-carousel" id="test3">
            <div carousel-item id="goods_shengxian">
                <div>
                    <li></li>
                    <li></li>
                </div>
                <div>
                    <li></li>
                    <li></li>
                </div>
                <div>
                    <li></li>
                    <li></li>
                </div>
                <div>
                    <li></li>
                    <li></li>
                </div>
                <div>
                    <li></li>
                    <li></li>
                </div>

            </div>
        </div>
        <!-- 京东秒杀轮播图部分  -->
        <div class="layui-carousel" id="test4">
            <div carousel-item>
                <div><img src="../img/2a0536b9d3e33a9b.jpg.webp" alt=""></div>
                <div><img src="../img/361ba1aa29cc9953.jpg.webp" alt=""></div>
            </div>
        </div>
    </div>
    </div>
    <!-- 猜你喜欢 -->
    <div id="list1">
      <!--   <div class="bbt">
            <h2></h2>
            <p></p>
            <img src="" alt="">
            <span></span>
        </div> -->
    </div>
    <button id="loadMore" style="border:solid 2px red; display: block;margin: 0 auto;">加载更多</button>
    <!-- 京东底部 -->
    <div>
        <footer>
            <!-- 服务模块 -->
            <div class="service">
                <div class="wrap">
                    <ul>
                        <li>
                            <h5>多</h5>
                            <p>品类齐全，轻松购物</p>
                        </li>
                        <li>
                            <h5>快</h5>
                            <p>多仓直发，极速配送</p>
                        </li>
                        <li>
                            <h5>好</h5>
                            <p>正品行货，精致服务</p>
                        </li>
                        <li>
                            <h5>省</h5>
                            <p>天天低价，畅选无忧</p>
                        </li>
                    </ul>
                </div>
            </div>
            <!-- 帮助模块 -->
            <div class="wrap help">
                <!-- wrap和help的ccs样式同时适用于div -->
                <div class="fl">
                    <dl>
                        <dt>购物指南</dt>
                        <dd><a href="#">购物流程</a></dd>
                        <dd><a href="#">会员介绍</a></dd>
                        <dd><a href="#">生活旅行</a></dd>
                        <dd><a href="#">常见问题</a></dd>
                        <dd><a href="#">大家电</a></dd>
                        <dd><a href="#">联系客服</a></dd>
                    </dl>
                    <dl>
                        <dt>配送方式</dt>
                        <dd><a href="#">上门自提</a></dd>
                        <dd><a href="#">211限时达</a></dd>
                        <dd><a href="#">配送服务查询</a></dd>
                        <dd><a href="#">配送费收取标准</a></dd>
                        <dd><a href="#">海外配送</a></dd>
                    </dl>
                    <dl>
                        <dt>支付方式</dt>
                        <dd><a href="#">货到付款</a></dd>
                        <dd><a href="#">在线支付</a></dd>
                        <dd><a href="#">分期付款</a></dd>
                        <dd><a href="#">邮局汇款</a></dd>
                        <dd><a href="#">公司转账</a></dd>
                    </dl>
                    <dl>
                        <dt>售后服务</dt>
                        <dd><a href="#">售后政策</a></dd>
                        <dd><a href="#">价格保护</a></dd>
                        <dd><a href="#">退款说明</a></dd>
                        <dd><a href="#">返修/退换货</a></dd>
                        <dd><a href="#">取消订单</a></dd>
                    </dl>
                    <dl>
                        <dt>特色服务</dt>
                        <dd><a href="#">夺宝岛</a></dd>
                        <dd><a href="#">DIY装机</a></dd>
                        <dd><a href="#">延保服务</a></dd>
                        <dd><a href="#">京东E卡</a></dd>
                        <dd><a href="#">京东通信</a></dd>
                        <dd><a href="#">京东JD+</a></dd>
                    </dl>
                </div>
                <div class="fr coverage">
                    <h5>京东自营覆盖区县</h5>
                    <p>京东已向全国2661个区县提供自营配送服务，支持货到付款、POS机刷卡和售后上门服务。</p>
                    <a href="#">查看详情></a>
                </div>
            </div>
            <!-- 底部版权模块 -->
            <div class="wrap copyright">
                <p>
                    <a href="#">关于我们</a>
                    <span> | </span>
                    <a href="#">联系我们</a>
                    <span> | </span>
                    <a href="#">联系客服</a>
                    <span> | </span>
                    <a href="#">合作招商</a>
                    <span> | </span>
                    <a href="#">商家帮助</a>
                    <span> | </span>
                    <a href="#">营销中心</a>
                    <span> | </span>
                    <a href="#">手机京东</a>
                    <span> | </span>
                    <a href="#">友情链接</a>
                    <span> | </span>
                    <a href="#">销售联盟</a>
                    <span> | </span>
                    <a href="#">京东社区</a>
                    <span> | </span>
                    <a href="#">风险监测</a>
                    <span> | </span>
                    <a href="#">京东公益</a>
                    <span> | </span>
                    <a href="#">English Site</a>
                    <span> | </span>
                    <a href="#">Media & IR</a>
                </p>
                <div class="register">
                    <p><a href="#">京公网安备 11000002000088号</a><span> | </span>
                        京ICP证070359号<span> | </span>
                        <a href="#">互联网药品信息服务资格证编号(京)-经营性-2014-0008</a><span> | </span>
                        新出发京零 字第大120007号
                    </p>
                    <p>互联网出版许可证编号新出网证(京)字150号<span> | </span><a href="#">出版物经营许可证</a><span> |
                        </span>网络文化经营许可证京网文[2014]2148-348号<span> | </span>违法和不良信息举报电话：4006561155
                    </p>
                    <p>Copyright © 2004 - 2018 京东JD.com 版权所有<span> | </span>
                        消费者维权热线：4006067733 &nbsp;&nbsp;<a href="#">经营证照</a><span> | </span>
                        (京)网械平台备字(2018)第00003号
                    </p>
                    <p><a href="#"><i class="Global"></i>Global Site</a><span> | </span>
                        <a href="#"><i class="Ca"></i>Сайт России</a><span> | </span>
                        <a href="#"><i class="Situs"></i>Situs Indonesia</a><span> | </span>
                        <a href="#"><i class="Sitio"></i>Sitio de España</a><span> | </span>
                        <a href="#"><i class="Thailand"></i>เว็บไซต์ประเทศไทย</a>
                    </p>
                    <p>京东旗下网站：<a href="#">京东钱包</a><span> | </span><a href="#">京东云</a></p>
                </div>
                <p class="foot-icon">
                    <a href="#"></a>
                    <a href="#"></a>
                    <a href="#"></a>
                    <a href="#"></a>
                    <a href="#"></a>
                    <a href="#"></a>
                </p>
            </div>
        </footer>
    </div>
</body>
<script>
    Ajax('#goods_shengxian li', 10004264)
    fn()
    //左侧三级导航栏
    function fn() {
        var Lis = document.getElementsByTagName("li");
        for (i = 0; i < Lis.length; i++) {
            Lis[i].i = i;
            Lis[i].onmouseover = function () {
                this.className = "lihover";
                var h0 = (this.i - 1) * 30 + 42;
                var y = this.getElementsByTagName(".topmenu div")[0].offsetHeight;
                var h = this.getElementsByTagName(".topmenu div")[0].style.top;
                if (h < h0) {/* 当悬浮层内容很少的时候，让它不在顶部*/
                    this.getElementsByTagName("div")[0].style.top = h0 + "px";
                }
                if (y > 550) {/* 当悬浮层内容太多，下面显示不完，让它向上显示*/
                    this.getElementsByTagName("div")[0].style.top = "3px";
                }
            }
            Lis[i].onmouseout = function () {
                this.className = "";

            }
        }
    }
    lubo();
    //轮播图片1
    function lubo() {
        layui.use('carousel', function () {
            var carousel = layui.carousel;
            //建造实例
            carousel.render({
                elem: '#test1'
                , width: '600px' //设置容器宽度
                , height: "435px"
                , arrow: 'always' //始终显示箭头
                , anim: 'fade' //切换动画方式
            });
        });
    }
    //轮播图片2
    lubo2()
    function lubo2() {
        layui.use('carousel', function () {
            var carousel = layui.carousel;
            //建造实例
            carousel.render({
                elem: '#test2'
                , width: '180px' //设置容器宽度
                , height: "435px"
                , arrow: 'always' //始终显示箭头
                , anim: 'fade' //切换动画方式
                , indicator: "none"
            });
        });
    }
    //倒计时
    tiems()
    function tiems() {
        let hour = document.querySelector(".hour");
        let min = document.querySelector(".min");
        let sec = document.querySelector(".sec");

        let D1 = new Date("2021-2-11");
        let timer = setInterval(() => {
            let now = new Date();
            // console.log(now);
            let cut = D1 - now;
            // console.log(cut);
            hour.innerHTML = parseInt(cut / 1000 / 60 / 60);
            min.innerHTML = parseInt(cut / 1000 / 60) % 60;
            sec.innerHTML = parseInt(cut / 1000) % 60;
        }, 1000);
    }
    //倒计时轮播图 京东秒杀 1
    lubo3()
    function lubo3() {
        layui.use('carousel', function () {
            var carousel = layui.carousel;
            //建造实例
            carousel.render({
                elem: '#test3'
                , width: '800px' //设置容器宽度
                , height: "260px"
                , arrow: 'always' //始终显示箭头
                , anim: 'fade' //切换动画方式
                , autoplay: 'boolean'
                , indicator: "none"
            });
        });
    }
    //倒计时轮播图 京东秒杀 2
    lubo4()
    function lubo4() {
        layui.use('carousel', function () {
            var carousel = layui.carousel;
            //建造实例
            carousel.render({
                elem: '#test4'
                , width: '190px' //设置容器宽度
                , height: "260px"
                , arrow: 'always' //始终显示箭头
                , anim: 'fade' //切换动画方式
                , autoplay: 'boolean'
            });
        });
    }
    //流加载
    let uid = localStorage.getItem('id');
    let token = localStorage.getItem('token');
    let username = localStorage.getItem('username');
    let pagenum = 11
    console.log(uid,token,username )
    loadList()
    // 1-创建对象 

    let loadMore = document.querySelector('#loadMore')
    loadMore.onclick = function () {
        pagenum++;
        loadList()
    }

    function loadList() {
        let xhr = new XMLHttpRequest()

        // 2- 打开链接 
        let url = 'http://jx.xuzhixiang.top/ap/api/allproductlist.php?pagesize=20&pagenum=' + pagenum

        // 请求方式 get post 
        // 请求接口的地址 
        // true 异步 false同步，默认是异步
        xhr.open('get', url, true)

        // 3-发送请求 
        // post 请求 参数  send（pagesize=20&pagenum=1）
        // get 请求参数 在url 里面
        xhr.send(null)

        // 响应数据   服务器返回的数据   一开始是空字符串
        console.log(xhr.responseText);

        // 等请求完成了 才会有数据 

        // onload 请求完成以后执行
        xhr.onload = function () {
            console.log(xhr.responseText);
            console.log(33);

            // 请求的状态码 200 
            if (xhr.status == 200) {
                let jsonStr = xhr.responseText;
                let obj = JSON.parse(jsonStr);
                console.log(obj);
                // 结果处理  数组【obj，obj】-》 li 
                let html = ''
                obj.data.forEach(pObj => {
                    html += 
                `
                <a href="item.html?id=${pObj.pid}
                <span>${pObj.pname}</span>"<div class="bbt layui-anim layui-anim-up ">
                        <img src="${pObj.pimg}" alt="">
                        <p>${pObj.pdesc}</p>
                        <span>价格：${pObj.pprice}</span>
                    </div></a>
                 `
                })

                let listUl = document.querySelector('#list1')
                listUl.innerHTML += html

            } else {
                //404 
                // 500
            }

        }
        xhr.onerror = function (error) {
            //请求出错  断网
            console.log(error);
            alert('请检查网络')
        }
    }
    /*   购物车 */

    




</script>

</html>